<template>
	<view @click="goUserDetail"
		style="width: 100%;display: flex;align-items: center;padding: 16rpx;border-bottom: 1rpx solid #f3f3f3;">
		<image :src="avatar" style="width: 80rpx;height: 80rpx;border-radius: 10rpx;" mode=""></image>
		<view style="flex:1;display: flex;margin-left: 20rpx;flex-direction: column;">
			<view style="font-size: 32rpx;">
				{{name}}
			</view>
			<view style="font-size: 25rpx;color: #7d7d7d;">
				{{makePhoneStr(phone)}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "userItem",
		props: {
			avatar: {
				type: String,
				default: "/static/images/icon_defaultavatar.png"
			},
			name: {
				type: String,
				default: ""
			},
			phone: {
				type: String,
				default: ""
			},
			show:{
				type:Boolean,
				default:false
			},
			showChange:{
				type:Function
			},
			id:{
				type:Number
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			goUserDetail: function() {
				// this.showChange()
				uni.navigateTo({
					url:"/pages/address/userinfo/index?id="+this.id
				})
			},
			makePhoneStr: function(tel) {
				return tel.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
			}
		}
	}
</script>

<style>
</style>